{% extends "_base.html" %}

{% block main %}
<script>
    $(function () {
        $('#profile').submit(function (e) {
            e.preventDefault();
            var data = {
                title: $('#Title').val(),
                questionDetails: $('#floatingTextarea2').val(),
                sponsor_id: $('#accountID').val()
            };
            $.ajax({
                type: 'post',
                url: '/postQuestion',
                data: JSON.stringify(data),
                success: function (resp) {
                    if (resp.error) {
                        // $('#error').text(resp.error);
                        location.assign('/signinIndex');
                        $('#error').text(resp.error);
                    } else {
                        location.assign('/');
                    }
                },
                contentType: 'application/json',
                dataType: 'json'
            });
        });
    });
</script>
<h3>Profile</h3>


<div class="container">
    <ul class="list-group" style="margin-top: 50px">
        <li class="list-group-item d-flex justify-content-between align-items-center">
            我的提问
            <span class="badge bg-primary rounded-pill">14</span>
        </li>
        <li class="list-group-item d-flex justify-content-between align-items-center">
            我的回答
            <span class="badge bg-primary rounded-pill">2</span>
        </li>
        <li class="list-group-item d-flex justify-content-between align-items-center">
            我的关注
            <span class="badge bg-primary rounded-pill">1</span>
        </li>
    </ul>

</div>

<div class="container" style="margin-top: 50px">
    <div class="card">
        <form id="profile">
        <div class="card-body">
            用户信息
            <ul class="list-group list-group-flush" style="margin-top: 50px">
                <li class="list-group-item">用户名<label style="margin-left: 2%;color: cornflowerblue">{{account.accountName }}</label></li>
                <li class="list-group-item">密码<label style="margin-left: 3%;color: cornflowerblue">{{account.password }}</label></li>
<!--                <li class="list-group-item">地区<label style="margin-left: 3%;color: cornflowerblue">123</label></li>-->
                <li class="list-group-item">硬币<label style="margin-left: 3%;color: cornflowerblue">{{account.coins }}</label></li>
                <li class="list-group-item">经验<label style="margin-left: 3%;color: cornflowerblue">{{account.points }}</label></li>
                <li class="list-group-item">等级<label style="margin-left: 3%;color: cornflowerblue">{{account.level }}</label></li>

            </ul>
        </div>
        </form>
    </div>

</div>



{% endblock %}
